Light Source Types

The amount of ambient light present in a scene is controlled by a pseudo light source of type ambient.


\begin{defkey}{light}{{\em Intensity\/} ambient}
Define the amount of ambient light present in the entire
scene.
\end{defkey}

There is only one ambient light source; its default intensity is 1, 1, 1. If more than one ambient light source is defined, only the last instance is used. A surface's ambient color is multiplied by the intensity of the ambient source to give the total ambient light reflected from the surface.

Directional sources are described by a direction alone, and are useful for modeling light sources that are effectively infinitely far away from the objects they illuminate.


\begin{defkey}{light}{{\em Intensity\/} {\tt directional} \evec{direction}}
Def...
... every point
it illuminates. The direction need not be normalized.
\end{defkey}

Point sources are defined as a single point in space. They produce shadows with sharp edges and are a good replacement for extended and other computationally expensive light source.


\begin{defkey}{light}{{\em Intensity\/} {\tt point} \evec{pos}}
Place a point light source with the given intensity at the
given position.
\end{defkey}

Spotlights are useful for creating dramatic localized lighting effects. They are defined by their position, the direction in which they are pointing, and the width of the beam of light they produce.


\begin{defkey}{light}{{\em Intensity\/} {\tt spot} \evec{pos} \evec{to}
{$\alph...
...control the radius of the cone of light
produced by the spotlight.
\end{defkey}
θin is the the angle at which the light source begins to be attenuated. At θout, the spotlight intensity is zero. This affords control over how ``fuzzy'' the edges of the spotlight are. If neither angle is given, they both are effectively set to 180 degrees.

Extended sources are meant to model spherical light sources. Unlike point sources, extended sources actually possess a radius, and as such are capable or producing shadows with fuzzy edges (penumbrae). If you do not specifically desire penumbrae in your image, use a point source instead.


\begin{defkey}{light}{{\em Intensity\/} {\tt extended} {\em radius} \evec{pos} }...
...ight source at the given position and with
the given {\em radius}.
\end{defkey}
The shadows cast by extended sources are modeled by taking samples of the source at different locations on its surface. When the source is partially hidden from a given point in space, that point is in partial shadow with respect to the extended source, and the sampling process is usually able to determine this fact.

Quadrilateral light sources are computationally more expensive than extended light sources, but are more flexible and produce more realistic results. This is due to the fact that an area source is approximated by a number of point sources whose positions are jittered to reduce aliasing. Because each of these point sources has shading calculations performed individually, area sources may be placed relatively close to the objects it illuminates, and a reasonable image will result.


\begin{defkey}{light}{{\em Intensity\/} {\tt area} \evec{p1} \evec{p2} {\em usam...
...p3}. Along this axis a total of
{\em vsamp} samples will be taken.
\end{defkey}
The values of usamp and vsamp are usually chosen to be proportional to the lengths of the u and v axes. Choosing a relatively high number of samples will result in a good approximation to a ``real'' quadrilateral source. However, because complete lighting calculations are performed for each sample, the computational cost is directly proportional to the product of usamp and vsamp.